1 /*
2  * This file is part of gtkD.
3  *
4  * gtkD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License
6  * as published by the Free Software Foundation; either version 3
7  * of the License, or (at your option) any later version, with
8  * some exceptions, please read the COPYING file.
9  *
10  * gtkD is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with gtkD; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
18  */
19 
20 // generated automatically - do not change
21 // find conversion definition on APILookup.txt
22 // implement new conversion functionalities on the wrap.utils pakage
23 
24 
25 module gdkpixbuf.c.types;
26 
27 public import gio.c.types;
28 public import glib.c.types;
29 public import gobject.c.types;
30 
31 
32 /**
33  * This enumeration defines the color spaces that are supported by
34  * the gdk-pixbuf library.
35  *
36  * Currently only RGB is supported.
37  */
38 public enum GdkColorspace
39 {
40 	/**
41 	 * Indicates a red/green/blue additive color space.
42 	 */
43 	RGB = 0,
44 }
45 alias GdkColorspace Colorspace;
46 
47 /**
48  * Interpolation modes for scaling functions.
49  *
50  * The `GDK_INTERP_NEAREST` mode is the fastest scaling method, but has
51  * horrible quality when scaling down; `GDK_INTERP_BILINEAR` is the best
52  * choice if you aren't sure what to choose, it has a good speed/quality
53  * balance.
54  *
55  * **Note**: Cubic filtering is missing from the list; hyperbolic
56  * interpolation is just as fast and results in higher quality.
57  */
58 public enum GdkInterpType
59 {
60 	/**
61 	 * Nearest neighbor sampling; this is the fastest
62 	 * and lowest quality mode. Quality is normally unacceptable when scaling
63 	 * down, but may be OK when scaling up.
64 	 */
65 	NEAREST = 0,
66 	/**
67 	 * This is an accurate simulation of the PostScript
68 	 * image operator without any interpolation enabled.  Each pixel is
69 	 * rendered as a tiny parallelogram of solid color, the edges of which
70 	 * are implemented with antialiasing.  It resembles nearest neighbor for
71 	 * enlargement, and bilinear for reduction.
72 	 */
73 	TILES = 1,
74 	/**
75 	 * Best quality/speed balance; use this mode by
76 	 * default. Bilinear interpolation.  For enlargement, it is
77 	 * equivalent to point-sampling the ideal bilinear-interpolated image.
78 	 * For reduction, it is equivalent to laying down small tiles and
79 	 * integrating over the coverage area.
80 	 */
81 	BILINEAR = 2,
82 	/**
83 	 * This is the slowest and highest quality
84 	 * reconstruction function. It is derived from the hyperbolic filters in
85 	 * Wolberg's "Digital Image Warping", and is formally defined as the
86 	 * hyperbolic-filter sampling the ideal hyperbolic-filter interpolated
87 	 * image (the filter is designed to be idempotent for 1:1 pixel mapping).
88 	 * **Deprecated**: this interpolation filter is deprecated, as in reality
89 	 * it has a lower quality than the @GDK_INTERP_BILINEAR filter
90 	 * (Since: 2.38)
91 	 */
92 	HYPER = 3,
93 }
94 alias GdkInterpType InterpType;
95 
96 /**
97  * Control the alpha channel for drawables.
98  *
99  * These values can be passed to gdk_pixbuf_xlib_render_to_drawable_alpha()
100  * in gdk-pixbuf-xlib to control how the alpha channel of an image should
101  * be handled.
102  *
103  * This function can create a bilevel clipping mask (black and white) and use
104  * it while painting the image.
105  *
106  * In the future, when the X Window System gets an alpha channel extension,
107  * it will be possible to do full alpha compositing onto arbitrary drawables.
108  * For now both cases fall back to a bilevel clipping mask.
109  *
110  * Deprecated: There is no user of GdkPixbufAlphaMode in GdkPixbuf,
111  * and the Xlib utility functions have been split out to their own
112  * library, gdk-pixbuf-xlib
113  */
114 public enum GdkPixbufAlphaMode
115 {
116 	/**
117 	 * A bilevel clipping mask (black and white)
118 	 * will be created and used to draw the image.  Pixels below 0.5 opacity
119 	 * will be considered fully transparent, and all others will be
120 	 * considered fully opaque.
121 	 */
122 	BILEVEL = 0,
123 	/**
124 	 * For now falls back to #GDK_PIXBUF_ALPHA_BILEVEL.
125 	 * In the future it will do full alpha compositing.
126 	 */
127 	FULL = 1,
128 }
129 alias GdkPixbufAlphaMode PixbufAlphaMode;
130 
131 /**
132  * An error code in the `GDK_PIXBUF_ERROR` domain.
133  *
134  * Many gdk-pixbuf operations can cause errors in this domain, or in
135  * the `G_FILE_ERROR` domain.
136  */
137 public enum GdkPixbufError
138 {
139 	/**
140 	 * An image file was broken somehow.
141 	 */
142 	CORRUPT_IMAGE = 0,
143 	/**
144 	 * Not enough memory.
145 	 */
146 	INSUFFICIENT_MEMORY = 1,
147 	/**
148 	 * A bad option was passed to a pixbuf save module.
149 	 */
150 	BAD_OPTION = 2,
151 	/**
152 	 * Unknown image type.
153 	 */
154 	UNKNOWN_TYPE = 3,
155 	/**
156 	 * Don't know how to perform the
157 	 * given operation on the type of image at hand.
158 	 */
159 	UNSUPPORTED_OPERATION = 4,
160 	/**
161 	 * Generic failure code, something went wrong.
162 	 */
163 	FAILED = 5,
164 	/**
165 	 * Only part of the animation was loaded.
166 	 */
167 	INCOMPLETE_ANIMATION = 6,
168 }
169 alias GdkPixbufError PixbufError;
170 
171 /**
172  * Flags which allow a module to specify further details about the supported
173  * operations.
174  *
175  * Since: 2.2
176  */
177 public enum GdkPixbufFormatFlags
178 {
179 	/**
180 	 * the module can write out images in the format.
181 	 */
182 	WRITABLE = 1,
183 	/**
184 	 * the image format is scalable
185 	 */
186 	SCALABLE = 2,
187 	/**
188 	 * the module is threadsafe. gdk-pixbuf
189 	 * ignores modules that are not marked as threadsafe. (Since 2.28).
190 	 */
191 	THREADSAFE = 4,
192 }
193 alias GdkPixbufFormatFlags PixbufFormatFlags;
194 
195 /**
196  * The possible rotations which can be passed to gdk_pixbuf_rotate_simple().
197  *
198  * To make them easier to use, their numerical values are the actual degrees.
199  */
200 public enum GdkPixbufRotation
201 {
202 	/**
203 	 * No rotation.
204 	 */
205 	NONE = 0,
206 	/**
207 	 * Rotate by 90 degrees.
208 	 */
209 	COUNTERCLOCKWISE = 90,
210 	/**
211 	 * Rotate by 180 degrees.
212 	 */
213 	UPSIDEDOWN = 180,
214 	/**
215 	 * Rotate by 270 degrees.
216 	 */
217 	CLOCKWISE = 270,
218 }
219 alias GdkPixbufRotation PixbufRotation;
220 
221 /**
222  * An enumeration which is used by gdk_pixdata_to_csource() to
223  * determine the form of C source to be generated. The three values
224  * @GDK_PIXDATA_DUMP_PIXDATA_STREAM, @GDK_PIXDATA_DUMP_PIXDATA_STRUCT
225  * and @GDK_PIXDATA_DUMP_MACROS are mutually exclusive, as are
226  * @GDK_PIXBUF_DUMP_GTYPES and @GDK_PIXBUF_DUMP_CTYPES. The remaining
227  * elements are optional flags that can be freely added.
228  */
229 public enum GdkPixdataDumpType
230 {
231 	/**
232 	 * Generate pixbuf data stream (a single
233 	 * string containing a serialized #GdkPixdata structure in network byte
234 	 * order).
235 	 */
236 	PIXDATA_STREAM = 0,
237 	/**
238 	 * Generate #GdkPixdata structure (needs
239 	 * the #GdkPixdata structure definition from gdk-pixdata.h).
240 	 */
241 	PIXDATA_STRUCT = 1,
242 	/**
243 	 * Generate <function>*_ROWSTRIDE</function>,
244 	 * <function>*_WIDTH</function>, <function>*_HEIGHT</function>,
245 	 * <function>*_BYTES_PER_PIXEL</function> and
246 	 * <function>*_RLE_PIXEL_DATA</function> or <function>*_PIXEL_DATA</function>
247 	 * macro definitions for the image.
248 	 */
249 	MACROS = 2,
250 	/**
251 	 * Generate GLib data types instead of
252 	 * standard C data types.
253 	 */
254 	GTYPES = 0,
255 	/**
256 	 * Generate standard C data types instead of
257 	 * GLib data types.
258 	 */
259 	CTYPES = 256,
260 	/**
261 	 * Generate static symbols.
262 	 */
263 	STATIC = 512,
264 	/**
265 	 * Generate const symbols.
266 	 */
267 	CONST = 1024,
268 	/**
269 	 * Provide a <function>*_RUN_LENGTH_DECODE(image_buf, rle_data, size, bpp)</function>
270 	 * macro definition  to  decode  run-length encoded image data.
271 	 */
272 	RLE_DECODER = 65536,
273 }
274 alias GdkPixdataDumpType PixdataDumpType;
275 
276 /**
277  * An enumeration containing three sets of flags for a #GdkPixdata struct:
278  * one for the used colorspace, one for the width of the samples and one
279  * for the encoding of the pixel data.
280  */
281 public enum GdkPixdataType
282 {
283 	/**
284 	 * each pixel has red, green and blue samples.
285 	 */
286 	COLOR_TYPE_RGB = 1,
287 	/**
288 	 * each pixel has red, green and blue samples
289 	 * and an alpha value.
290 	 */
291 	COLOR_TYPE_RGBA = 2,
292 	/**
293 	 * mask for the colortype flags of the enum.
294 	 */
295 	COLOR_TYPE_MASK = 255,
296 	/**
297 	 * each sample has 8 bits.
298 	 */
299 	SAMPLE_WIDTH_8 = 65536,
300 	/**
301 	 * mask for the sample width flags of the enum.
302 	 */
303 	SAMPLE_WIDTH_MASK = 983040,
304 	/**
305 	 * the pixel data is in raw form.
306 	 */
307 	ENCODING_RAW = 16777216,
308 	/**
309 	 * the pixel data is run-length encoded. Runs may
310 	 * be up to 127 bytes long; their length is stored in a single byte
311 	 * preceding the pixel data for the run. If a run is constant, its length
312 	 * byte has the high bit set and the pixel data consists of a single pixel
313 	 * which must be repeated.
314 	 */
315 	ENCODING_RLE = 33554432,
316 	/**
317 	 * mask for the encoding flags of the enum.
318 	 */
319 	ENCODING_MASK = 251658240,
320 }
321 alias GdkPixdataType PixdataType;
322 
323 struct GdkPixbuf;
324 
325 struct GdkPixbufAnimation
326 {
327 	GObject parentInstance;
328 }
329 
330 /**
331  * Modules supporting animations must derive a type from
332  * #GdkPixbufAnimation, providing suitable implementations of the
333  * virtual functions.
334  */
335 struct GdkPixbufAnimationClass
336 {
337 	/**
338 	 * the parent class
339 	 */
340 	GObjectClass parentClass;
341 	/**
342 	 *
343 	 * Params:
344 	 *     animation = a #GdkPixbufAnimation
345 	 * Returns: `TRUE` if the "animation" was really just an image
346 	 */
347 	extern(C) int function(GdkPixbufAnimation* animation) isStaticImage;
348 	/**
349 	 *
350 	 * Params:
351 	 *     animation = a #GdkPixbufAnimation
352 	 * Returns: unanimated image representing the animation
353 	 */
354 	extern(C) GdkPixbuf* function(GdkPixbufAnimation* animation) getStaticImage;
355 	/** */
356 	extern(C) void function(GdkPixbufAnimation* animation, int* width, int* height) getSize;
357 	/**
358 	 *
359 	 * Params:
360 	 *     animation = a #GdkPixbufAnimation
361 	 *     startTime = time when the animation starts playing
362 	 * Returns: an iterator to move over the animation
363 	 */
364 	extern(C) GdkPixbufAnimationIter* function(GdkPixbufAnimation* animation, GTimeVal* startTime) getIter;
365 }
366 
367 struct GdkPixbufAnimationIter
368 {
369 	GObject parentInstance;
370 }
371 
372 /**
373  * Modules supporting animations must derive a type from
374  * #GdkPixbufAnimationIter, providing suitable implementations of the
375  * virtual functions.
376  */
377 struct GdkPixbufAnimationIterClass
378 {
379 	/**
380 	 * the parent class
381 	 */
382 	GObjectClass parentClass;
383 	/**
384 	 *
385 	 * Params:
386 	 *     iter = an animation iterator
387 	 * Returns: delay time in milliseconds (thousandths of a second)
388 	 */
389 	extern(C) int function(GdkPixbufAnimationIter* iter) getDelayTime;
390 	/**
391 	 *
392 	 * Params:
393 	 *     iter = an animation iterator
394 	 * Returns: the pixbuf to be displayed
395 	 */
396 	extern(C) GdkPixbuf* function(GdkPixbufAnimationIter* iter) getPixbuf;
397 	/**
398 	 *
399 	 * Params:
400 	 *     iter = a #GdkPixbufAnimationIter
401 	 * Returns: `TRUE` if the frame we're on is partially loaded, or the last frame
402 	 */
403 	extern(C) int function(GdkPixbufAnimationIter* iter) onCurrentlyLoadingFrame;
404 	/**
405 	 *
406 	 * Params:
407 	 *     iter = a #GdkPixbufAnimationIter
408 	 *     currentTime = current time
409 	 * Returns: `TRUE` if the image may need updating
410 	 */
411 	extern(C) int function(GdkPixbufAnimationIter* iter, GTimeVal* currentTime) advance;
412 }
413 
414 struct GdkPixbufFormat
415 {
416 	/**
417 	 * the name of the image format
418 	 */
419 	char* name;
420 	/**
421 	 * the signature of the module
422 	 */
423 	GdkPixbufModulePattern* signature;
424 	/**
425 	 * the message domain for the `description`
426 	 */
427 	char* domain;
428 	/**
429 	 * a description of the image format
430 	 */
431 	char* description;
432 	/**
433 	 * the MIME types for the image format
434 	 */
435 	char** mimeTypes;
436 	/**
437 	 * typical filename extensions for the
438 	 * image format
439 	 */
440 	char** extensions;
441 	/**
442 	 * a combination of `GdkPixbufFormatFlags`
443 	 */
444 	uint flags;
445 	/**
446 	 * a boolean determining whether the loader is disabled`
447 	 */
448 	bool disabled;
449 	/**
450 	 * a string containing license information, typically set to
451 	 * shorthands like "GPL", "LGPL", etc.
452 	 */
453 	char* license;
454 }
455 
456 struct GdkPixbufLoader
457 {
458 	GObject parentInstance;
459 	void* priv;
460 }
461 
462 struct GdkPixbufLoaderClass
463 {
464 	GObjectClass parentClass;
465 	/** */
466 	extern(C) void function(GdkPixbufLoader* loader, int width, int height) sizePrepared;
467 	/** */
468 	extern(C) void function(GdkPixbufLoader* loader) areaPrepared;
469 	/** */
470 	extern(C) void function(GdkPixbufLoader* loader, int x, int y, int width, int height) areaUpdated;
471 	/** */
472 	extern(C) void function(GdkPixbufLoader* loader) closed;
473 }
474 
475 /**
476  * A `GdkPixbufModule` contains the necessary functions to load and save
477  * images in a certain file format.
478  *
479  * If `GdkPixbuf` has been compiled with `GModule` support, it can be extended
480  * by modules which can load (and perhaps also save) new image and animation
481  * formats.
482  *
483  * ## Implementing modules
484  *
485  * The `GdkPixbuf` interfaces needed for implementing modules are contained in
486  * `gdk-pixbuf-io.h` (and `gdk-pixbuf-animation.h` if the module supports
487  * animations). They are not covered by the same stability guarantees as the
488  * regular GdkPixbuf API. To underline this fact, they are protected by the
489  * `GDK_PIXBUF_ENABLE_BACKEND` pre-processor symbol.
490  *
491  * Each loadable module must contain a `GdkPixbufModuleFillVtableFunc` function
492  * named `fill_vtable`, which will get called when the module
493  * is loaded and must set the function pointers of the `GdkPixbufModule`.
494  *
495  * In order to make format-checking work before actually loading the modules
496  * (which may require calling `dlopen` to load image libraries), modules export
497  * their signatures (and other information) via the `fill_info` function. An
498  * external utility, `gdk-pixbuf-query-loaders`, uses this to create a text
499  * file containing a list of all available loaders and  their signatures.
500  * This file is then read at runtime by `GdkPixbuf` to obtain the list of
501  * available loaders and their signatures.
502  *
503  * Modules may only implement a subset of the functionality available via
504  * `GdkPixbufModule`. If a particular functionality is not implemented, the
505  * `fill_vtable` function will simply not set the corresponding
506  * function pointers of the `GdkPixbufModule` structure. If a module supports
507  * incremental loading (i.e. provides `begin_load`, `stop_load` and
508  * `load_increment`), it doesn't have to implement `load`, since `GdkPixbuf`
509  * can supply a generic `load` implementation wrapping the incremental loading.
510  *
511  * ## Installing modules
512  *
513  * Installing a module is a two-step process:
514  *
515  * - copy the module file(s) to the loader directory (normally
516  * `$libdir/gdk-pixbuf-2.0/$version/loaders`, unless overridden by the
517  * environment variable `GDK_PIXBUF_MODULEDIR`)
518  * - call `gdk-pixbuf-query-loaders` to update the module file (normally
519  * `$libdir/gdk-pixbuf-2.0/$version/loaders.cache`, unless overridden
520  * by the environment variable `GDK_PIXBUF_MODULE_FILE`)
521  */
522 struct GdkPixbufModule
523 {
524 	/**
525 	 * the name of the module, usually the same as the
526 	 * usual file extension for images of this type, eg. "xpm", "jpeg" or "png".
527 	 */
528 	char* moduleName;
529 	/**
530 	 * the path from which the module is loaded.
531 	 */
532 	char* modulePath;
533 	/**
534 	 * the loaded `GModule`.
535 	 */
536 	GModule* module_;
537 	/**
538 	 * a `GdkPixbufFormat` holding information about the module.
539 	 */
540 	GdkPixbufFormat* info;
541 	/**
542 	 * loads an image from a file.
543 	 */
544 	GdkPixbufModuleLoadFunc load;
545 	/**
546 	 * loads an image from data in memory.
547 	 */
548 	GdkPixbufModuleLoadXpmDataFunc loadXpmData;
549 	/**
550 	 * begins an incremental load.
551 	 */
552 	GdkPixbufModuleBeginLoadFunc beginLoad;
553 	/**
554 	 * stops an incremental load.
555 	 */
556 	GdkPixbufModuleStopLoadFunc stopLoad;
557 	/**
558 	 * continues an incremental load.
559 	 */
560 	GdkPixbufModuleIncrementLoadFunc loadIncrement;
561 	/**
562 	 * loads an animation from a file.
563 	 */
564 	GdkPixbufModuleLoadAnimationFunc loadAnimation;
565 	/**
566 	 * saves a `GdkPixbuf` to a file.
567 	 */
568 	GdkPixbufModuleSaveFunc save;
569 	/**
570 	 * saves a `GdkPixbuf` by calling the given `GdkPixbufSaveFunc`.
571 	 */
572 	GdkPixbufModuleSaveCallbackFunc saveToCallback;
573 	/**
574 	 * returns whether a save option key is supported by the module
575 	 */
576 	GdkPixbufModuleSaveOptionSupportedFunc isSaveOptionSupported;
577 	/** */
578 	extern(C) void function() Reserved1;
579 	/** */
580 	extern(C) void function() Reserved2;
581 	/** */
582 	extern(C) void function() Reserved3;
583 	/** */
584 	extern(C) void function() Reserved4;
585 }
586 
587 /**
588  * The signature prefix for a module.
589  *
590  * The signature of a module is a set of prefixes. Prefixes are encoded as
591  * pairs of ordinary strings, where the second string, called the mask, if
592  * not `NULL`, must be of the same length as the first one and may contain
593  * ' ', '!', 'x', 'z', and 'n' to indicate bytes that must be matched,
594  * not matched, "don't-care"-bytes, zeros and non-zeros, respectively.
595  *
596  * Each prefix has an associated integer that describes the relevance of
597  * the prefix, with 0 meaning a mismatch and 100 a "perfect match".
598  *
599  * Starting with gdk-pixbuf 2.8, the first byte of the mask may be '*',
600  * indicating an unanchored pattern that matches not only at the beginning,
601  * but also in the middle. Versions prior to 2.8 will interpret the '*'
602  * like an 'x'.
603  *
604  * The signature of a module is stored as an array of
605  * `GdkPixbufModulePatterns`. The array is terminated by a pattern
606  * where the `prefix` is `NULL`.
607  *
608  * ```c
609  * GdkPixbufModulePattern *signature[] = {
610  * { "abcdx", " !x z", 100 },
611  * { "bla", NULL,  90 },
612  * { NULL, NULL, 0 }
613  * };
614  * ```
615  *
616  * In the example above, the signature matches e.g. "auud\0" with
617  * relevance 100, and "blau" with relevance 90.
618  *
619  * Since: 2.2
620  */
621 struct GdkPixbufModulePattern
622 {
623 	/**
624 	 * the prefix for this pattern
625 	 */
626 	char* prefix;
627 	/**
628 	 * mask containing bytes which modify how the prefix is matched against
629 	 * test data
630 	 */
631 	char* mask;
632 	/**
633 	 * relevance of this pattern
634 	 */
635 	int relevance;
636 }
637 
638 struct GdkPixbufNonAnim;
639 
640 struct GdkPixbufSimpleAnim;
641 
642 struct GdkPixbufSimpleAnimClass;
643 
644 struct GdkPixbufSimpleAnimIter;
645 
646 struct GdkPixdata
647 {
648 	/**
649 	 * magic number. A valid `GdkPixdata` structure must have
650 	 * `GDK_PIXBUF_MAGIC_NUMBER` here
651 	 */
652 	uint magic;
653 	/**
654 	 * less than 1 to disable length checks, otherwise
655 	 * `GDK_PIXDATA_HEADER_LENGTH` plus the length of `pixel_data`
656 	 */
657 	int length;
658 	/**
659 	 * information about colorspace, sample width and
660 	 * encoding, in a `GdkPixdataType`
661 	 */
662 	uint pixdataType;
663 	/**
664 	 * Distance in bytes between rows
665 	 */
666 	uint rowstride;
667 	/**
668 	 * Width of the image in pixels
669 	 */
670 	uint width;
671 	/**
672 	 * Height of the image in pixels
673 	 */
674 	uint height;
675 	/**
676 	 * `width` x `height`
677 	 * pixels, encoded according to `pixdata_type` and `rowstride`
678 	 */
679 	ubyte* pixelData;
680 }
681 
682 /**
683  * A function of this type is responsible for freeing the pixel array
684  * of a pixbuf.
685  *
686  * The gdk_pixbuf_new_from_data() function lets you pass in a pre-allocated
687  * pixel array so that a pixbuf can be created from it; in this case you
688  * will need to pass in a function of type `GdkPixbufDestroyNotify` so that
689  * the pixel data can be freed when the pixbuf is finalized.
690  *
691  * Params:
692  *     pixels = The pixel array of the pixbuf
693  *         that is being finalized.
694  *     data = User closure data.
695  */
696 public alias extern(C) void function(char* pixels, void* data) GdkPixbufDestroyNotify;
697 
698 /**
699  * Sets up the image loading state.
700  *
701  * The image loader is responsible for storing the given function pointers
702  * and user data, and call them when needed.
703  *
704  * The image loader should set up an internal state object, and return it
705  * from this function; the state object will then be updated from the
706  * [callback@GdkPixbuf.PixbufModuleIncrementLoadFunc] callback, and will be freed
707  * by [callback@GdkPixbuf.PixbufModuleStopLoadFunc] callback.
708  *
709  * Params:
710  *     sizeFunc = the function to be called when the size is known
711  *     preparedFunc = the function to be called when the data has been prepared
712  *     updatedFunc = the function to be called when the data has been updated
713  *     userData = the data to be passed to the functions
714  *
715  * Returns: the data to be passed to
716  *     [callback@GdkPixbuf.PixbufModuleIncrementLoadFunc]
717  *     and [callback@GdkPixbuf.PixbufModuleStopLoadFunc], or `NULL` in case of error
718  *
719  * Throws: GException on failure.
720  */
721 public alias extern(C) void* function(GdkPixbufModuleSizeFunc sizeFunc, GdkPixbufModulePreparedFunc preparedFunc, GdkPixbufModuleUpdatedFunc updatedFunc, void* userData, GError** err) GdkPixbufModuleBeginLoadFunc;
722 
723 /**
724  * Defines the type of the function used to fill a
725  * #GdkPixbufFormat structure with information about a module.
726  *
727  * Params:
728  *     info = a #GdkPixbufFormat.
729  *
730  * Since: 2.2
731  */
732 public alias extern(C) void function(GdkPixbufFormat* info) GdkPixbufModuleFillInfoFunc;
733 
734 /**
735  * Defines the type of the function used to set the vtable of a
736  * #GdkPixbufModule when it is loaded.
737  *
738  * Params:
739  *     module_ = a #GdkPixbufModule.
740  *
741  * Since: 2.2
742  */
743 public alias extern(C) void function(GdkPixbufModule* module_) GdkPixbufModuleFillVtableFunc;
744 
745 /**
746  * Incrementally loads a buffer into the image data.
747  *
748  * Params:
749  *     context = the state object created by [callback@GdkPixbuf.PixbufModuleBeginLoadFunc]
750  *     buf = the data to load
751  *     size = the length of the data to load
752  *
753  * Returns: `TRUE` if the incremental load was successful
754  *
755  * Throws: GException on failure.
756  */
757 public alias extern(C) int function(void* context, char* buf, uint size, GError** err) GdkPixbufModuleIncrementLoadFunc;
758 
759 /**
760  * Loads a file from a standard C file stream into a new `GdkPixbufAnimation`.
761  *
762  * In case of error, this function should return `NULL` and set the `error` argument.
763  *
764  * Params:
765  *     f = the file stream from which the image should be loaded
766  *
767  * Returns: a newly created `GdkPixbufAnimation` for the contents of the file
768  *
769  * Throws: GException on failure.
770  */
771 public alias extern(C) GdkPixbufAnimation* function(FILE* f, GError** err) GdkPixbufModuleLoadAnimationFunc;
772 
773 /**
774  * Loads a file from a standard C file stream into a new `GdkPixbuf`.
775  *
776  * In case of error, this function should return `NULL` and set the `error` argument.
777  *
778  * Params:
779  *     f = the file stream from which the image should be loaded
780  *
781  * Returns: a newly created `GdkPixbuf` for the contents of the file
782  *
783  * Throws: GException on failure.
784  */
785 public alias extern(C) GdkPixbuf* function(FILE* f, GError** err) GdkPixbufModuleLoadFunc;
786 
787 /**
788  * Loads XPM data into a new `GdkPixbuf`.
789  *
790  * Params:
791  *     data = the XPM data
792  *
793  * Returns: a newly created `GdkPixbuf` for the XPM data
794  */
795 public alias extern(C) GdkPixbuf* function(char** data) GdkPixbufModuleLoadXpmDataFunc;
796 
797 /**
798  * Defines the type of the function that gets called once the initial
799  * setup of @pixbuf is done.
800  *
801  * #GdkPixbufLoader uses a function of this type to emit the
802  * "<link linkend="GdkPixbufLoader-area-prepared">area_prepared</link>"
803  * signal.
804  *
805  * Params:
806  *     pixbuf = the #GdkPixbuf that is currently being loaded.
807  *     anim = if an animation is being loaded, the #GdkPixbufAnimation, else %NULL.
808  *     userData = the loader.
809  *
810  * Since: 2.2
811  */
812 public alias extern(C) void function(GdkPixbuf* pixbuf, GdkPixbufAnimation* anim, void* userData) GdkPixbufModulePreparedFunc;
813 
814 /**
815  * Saves a `GdkPixbuf` by calling the provided function.
816  *
817  * The optional `option_keys` and `option_values` arrays contain the keys and
818  * values (in the same order) for attributes to be saved alongside the image
819  * data.
820  *
821  * Params:
822  *     saveFunc = the function to call when saving
823  *     userData = the data to pass to @save_func
824  *     pixbuf = the `GdkPixbuf` to save
825  *     optionKeys = an array of option names
826  *     optionValues = an array of option values
827  *
828  * Returns: `TRUE` on success; in case of failure, `FALSE` is returned and
829  *     the `error` is set
830  *
831  * Throws: GException on failure.
832  */
833 public alias extern(C) int function(GdkPixbufSaveFunc saveFunc, void* userData, GdkPixbuf* pixbuf, char** optionKeys, char** optionValues, GError** err) GdkPixbufModuleSaveCallbackFunc;
834 
835 /**
836  * Saves a `GdkPixbuf` into a standard C file stream.
837  *
838  * The optional `param_keys` and `param_values` arrays contain the keys and
839  * values (in the same order) for attributes to be saved alongside the image
840  * data.
841  *
842  * Params:
843  *     f = the file stream into which the image should be saved
844  *     pixbuf = the image to save
845  *     paramKeys = parameter keys to save
846  *     paramValues = parameter values to save
847  *
848  * Returns: `TRUE` on success; in case of failure, `FALSE` is returned and
849  *     the `error` is set
850  *
851  * Throws: GException on failure.
852  */
853 public alias extern(C) int function(FILE* f, GdkPixbuf* pixbuf, char** paramKeys, char** paramValues, GError** err) GdkPixbufModuleSaveFunc;
854 
855 /**
856  * Checks whether the given `option_key` is supported when saving.
857  *
858  * Params:
859  *     optionKey = the option key to check
860  *
861  * Returns: `TRUE` if the option is supported
862  */
863 public alias extern(C) int function(const(char)* optionKey) GdkPixbufModuleSaveOptionSupportedFunc;
864 
865 /**
866  * Defines the type of the function that gets called once the size
867  * of the loaded image is known.
868  *
869  * The function is expected to set @width and @height to the desired
870  * size to which the image should be scaled. If a module has no efficient
871  * way to achieve the desired scaling during the loading of the image, it may
872  * either ignore the size request, or only approximate it - gdk-pixbuf will
873  * then perform the required scaling on the completely loaded image.
874  *
875  * If the function sets @width or @height to zero, the module should interpret
876  * this as a hint that it will be closed soon and shouldn't allocate further
877  * resources. This convention is used to implement gdk_pixbuf_get_file_info()
878  * efficiently.
879  *
880  * Params:
881  *     width = pointer to a location containing the current image width
882  *     height = pointer to a location containing the current image height
883  *     userData = the loader.
884  *
885  * Since: 2.2
886  */
887 public alias extern(C) void function(int* width, int* height, void* userData) GdkPixbufModuleSizeFunc;
888 
889 /**
890  * Finalizes the image loading state.
891  *
892  * This function is called on success and error states.
893  *
894  * Params:
895  *     context = the state object created by [callback@GdkPixbuf.PixbufModuleBeginLoadFunc]
896  *
897  * Returns: `TRUE` if the loading operation was successful
898  *
899  * Throws: GException on failure.
900  */
901 public alias extern(C) int function(void* context, GError** err) GdkPixbufModuleStopLoadFunc;
902 
903 /**
904  * Defines the type of the function that gets called every time a region
905  * of @pixbuf is updated.
906  *
907  * #GdkPixbufLoader uses a function of this type to emit the
908  * "<link linkend="GdkPixbufLoader-area-updated">area_updated</link>"
909  * signal.
910  *
911  * Params:
912  *     pixbuf = the #GdkPixbuf that is currently being loaded.
913  *     x = the X origin of the updated area.
914  *     y = the Y origin of the updated area.
915  *     width = the width of the updated area.
916  *     height = the height of the updated area.
917  *     userData = the loader.
918  *
919  * Since: 2.2
920  */
921 public alias extern(C) void function(GdkPixbuf* pixbuf, int x, int y, int width, int height, void* userData) GdkPixbufModuleUpdatedFunc;
922 
923 /**
924  * Save functions used by [method@GdkPixbuf.Pixbuf.save_to_callback].
925  *
926  * This function is called once for each block of bytes that is "written"
927  * by `gdk_pixbuf_save_to_callback()`.
928  *
929  * If successful it should return `TRUE`; if an error occurs it should set
930  * `error` and return `FALSE`, in which case `gdk_pixbuf_save_to_callback()`
931  * will fail with the same error.
932  *
933  * Params:
934  *     buf = bytes to be written.
935  *     count = number of bytes in @buf.
936  *     error = A location to return an error.
937  *     data = user data passed to gdk_pixbuf_save_to_callback().
938  *
939  * Returns: `TRUE` if successful, `FALSE` otherwise
940  *
941  * Since: 2.4
942  */
943 public alias extern(C) int function(char* buf, size_t count, GError** error, void* data) GdkPixbufSaveFunc;
944 
945 import core.stdc.stdio;
946 
947 /**
948  * Major version of gdk-pixbuf library, that is the "0" in
949  * "0.8.2" for example.
950  */
951 enum PIXBUF_MAJOR = 2;
952 alias GDK_PIXBUF_MAJOR = PIXBUF_MAJOR;
953 
954 /**
955  * Micro version of gdk-pixbuf library, that is the "2" in
956  * "0.8.2" for example.
957  */
958 enum PIXBUF_MICRO = 8;
959 alias GDK_PIXBUF_MICRO = PIXBUF_MICRO;
960 
961 /**
962  * Minor version of gdk-pixbuf library, that is the "8" in
963  * "0.8.2" for example.
964  */
965 enum PIXBUF_MINOR = 42;
966 alias GDK_PIXBUF_MINOR = PIXBUF_MINOR;
967 
968 /**
969  * Contains the full version of GdkPixbuf as a string.
970  *
971  * This is the version being compiled against; contrast with
972  * `gdk_pixbuf_version`.
973  */
974 enum PIXBUF_VERSION = "2.42.8";
975 alias GDK_PIXBUF_VERSION = PIXBUF_VERSION;
976 
977 /**
978  * Magic number for #GdkPixdata structures.
979  */
980 enum PIXBUF_MAGIC_NUMBER = 1197763408;
981 alias GDK_PIXBUF_MAGIC_NUMBER = PIXBUF_MAGIC_NUMBER;
982 
983 /**
984  * The length of a #GdkPixdata structure without the @pixel_data pointer.
985  */
986 enum PIXDATA_HEADER_LENGTH = 24;
987 alias GDK_PIXDATA_HEADER_LENGTH = PIXDATA_HEADER_LENGTH;